//鼠标点击效果
document.body.addEventListener('click', function (even) {
    console.log("鼠标位置", even.clientX, even.clientY)
    let mo = document.createElement('mo')
    mo.innerText = "☁"
    let fontSize = 30
    mo.style.fontSize = fontSize + "px"
    mo.style.left = even.clientX - fontSize / 2 + "px"
    mo.style.top = even.clientY - fontSize / 2 + "px"
    mo.style.color = randomColor()
    mo.style.display = "block"
    mo.style.position = "absolute"
    mo.style.opacity = 1
    mo.style.userSelect = "none"; // 添加该行代码
    mo.style.caretColor = "transparent";
    document.body.appendChild(mo)
    let timer = setInterval(function () {
        // console.log(mo.style.top)
        let top = parseInt(mo.style.top)
        top -= 5
        mo.style.top = top + "px"
        let opacity = parseFloat(mo.style.opacity)
        opacity -= 0.1
        mo.style.opacity = opacity
        if (opacity <= 0) {
            document.body.removeChild(mo)
            clearInterval(timer)
        }
    }, 100)
})
function randomColor() {
    let r = parseInt(Math.random() * 256)
    let g = parseInt(Math.random() * 256)
    let b = parseInt(Math.random() * 256)
    return "rgb(" + r + "," + g + "," + b + ")"
}